//
//  NSDate+Helper.h
//  LZLife
//
//  Created by 214 on 2021/3/16.
//

#import <Foundation/Foundation.h>

@interface NSDate (Helper)

/// NSDate转格式显示 yyyy-MM-dd
+ (NSString *)dateToString:(NSDate *)date dateFormatter:(NSString *)formatter;

/// 时间戳转格式显示 yyyy-MM-dd
+ (NSString *)timeIntervalToString:(NSTimeInterval)timeInterval dateFormatter:(NSString *)formatter;

/// 根据显示时间的字符串返回NSDate
+ (NSDate *)dateWithDateString:(NSString *)timeString formatString:(NSString *)format;

/// 在已有NSDate的情况下，加减具体数字的年月日，获取未来或者过去的NSDate
+ (NSDate *)dateWithPresentDate:(NSDate*)presentDate year:(NSInteger)year month:(NSInteger)month day:(NSInteger)day;

/// 根据具体的年月日获取NSDate
+ (NSDate *)dateWithYear:(NSInteger)year month:(NSInteger)month day:(NSInteger)day;

/// 根据前后NSDate，获取中间差了多少天
+ (NSInteger)daysBetweenStartDate:(NSDate *)startDate endDate:(NSDate *)endDate;

/// 获取传入Date对应的月份有多少天
+ (NSInteger)totaldaysInMonth:(NSDate *)date;

// 是否和当前同一天
+ (BOOL)isCurrentDay:(NSDate *)date;

//获取当前时间戳 （以毫秒为单位）
+(NSString *)getNowTimeTimestamp3;

//获取当前时间戳 （以秒为单位）
+(NSString *)getNowTimeTimestampS;

@end

